package com.googlecode.dgwt.client.dijit.base;



/**
 * @author      Wellington Tadeu dos Santos
 * @since       DGWT v0.01
 */
public interface HasTextAlignment {


    /**
     * Text alignment constant.
     */
    public static class TextAlignmentConstant {
        
        protected String textAlignString;

        protected TextAlignmentConstant(String textAlignString) {
            this.textAlignString = textAlignString;
        }

        /**
         * Gets the CSS 'text-align' string associated with this constant.
         * 
         * @return the CSS 'text-align' value
         */
        public String getTextAlignString() {
            return textAlignString;
        }
    }

    /**
     * Specifies that the widget's text should be aligned justified.
     */
    TextAlignmentConstant ALIGN_JUSTIFY = new TextAlignmentConstant("justify");

    /**
     * Specifies that the widget's text should be aligned in the center.
     */
    TextAlignmentConstant ALIGN_CENTER = new TextAlignmentConstant("center");

    /**
     * Specifies that the widget's text should be aligned to the left.
     */
    TextAlignmentConstant ALIGN_LEFT = new TextAlignmentConstant("left");

    /**
     * Specifies that the widget's text should be aligned to the right.
     */
    TextAlignmentConstant ALIGN_RIGHT = new TextAlignmentConstant("right");

    /**
     * Specifies that the widget's text should be aligned to the browser default.
     */
    TextAlignmentConstant ALIGN_DEFAULT = new TextAlignmentConstant("");

    /**
     * Sets the horizontal alignment.
     * 
     * @param align the horizontal alignment (
     *          {@link HasTextAlignment#ALIGN_LEFT},
     *          {@link HasTextAlignment#ALIGN_CENTER},
     *          {@link HasTextAlignment#ALIGN_RIGHT}), or
     *          {@link HasTextAlignment#ALIGN_DEFAULT}).
     */
    void setTextAlignment(TextAlignmentConstant align);

}
